package main

import (
	"fmt"
)

func main() {
	fmt.Printf("1.摄氏度转换华氏度 2.华氏度转换摄氏度\n请选择：")
	var choice int
	//var err error
	fmt.Scanf("%d", &choice) //Scanf断点但是Scan不断点
	//if (err != nil) {
	//	os.Exit(100)
	//}
	//fmt.Println(choice)

	var temp float64 = getNum()
	var result string
	if (choice == 1) {
		result = CtoF(Celsius(temp)).String()
	} else {
		result = FtoC(Fahrenheit(temp)).String()
	}

	fmt.Printf("结果是 %s", result);
}

func getNum() float64 {
	fmt.Printf("请输入数值：")
	var number float64
	fmt.Scanf("%f", &number)
	return number
}
